<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2022-11-28 13:48:00
 * @Last Modified time: 2022-11-28 16:07:21
 */

namespace app\sys\controller;	
use app\common\enum\EnumFactory;
use app\sys\controller\Base;
use frank\services\FileUploadService;
/**
 * Class Common
 */
class Common extends Base
{ 	
	/**
	 * 上传
     * @method(POST)
     */
    public function upload()
    {
		$service = FileUploadService::instance();
        $service->setPath('image');
        $param = array (
            "name" => "file",
            "source_id" =>$this->adminId,
            "group_id" =>0,
            "source" =>10,
        );
        if($data = $service->imagem($param)){
            $this->success('上传成功',$data);
        }
        $this->error($service->getError() ?: '上传失败');
    }
}
